package com.probox.common.entity.domain.product.vo;

import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.checkerframework.checker.units.qual.A;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

/**
 * 商品信息查询
 */
@ApiModel(description = "商品信息查询")
public class ProductInfoQuery implements Serializable {
    @ApiModelProperty(value = "页码")
    private Long pageNum;
    @ApiModelProperty(value = "每页数量")
    private Long pageSize;
    @ApiModelProperty(value = "分组uid")
    private Long groupUid;
    @ApiModelProperty(value = "活动uid")
    private Long activityUid;
    @ApiModelProperty(value = "商品uid")
    private Long productUid;
    @ApiModelProperty(value = "需要排序的字段（buyNum销量/price价格,没有就不传）")
    private String sortProperty;
    @ApiModelProperty(value = "倒序还是正序的字段,（传desc倒序,不传为正序）")
    private String sortType;
    @ApiModelProperty(value = "平台ID")
    private Long platformUid;
    @ApiModelProperty(value = "供应商ID")
    private Long supplierUid;
    @ApiModelProperty(value = "商品名称D")
    private String productName;
    @ApiModelProperty(value = "活动类型")
    private String activityType;
    @ApiModelProperty(hidden = true)
    private Long[] uids;
    @ApiModelProperty(hidden = true)
    private String uidsStr;
    private List<Long> proUids;
    @ApiModelProperty(value = "商品一级ID")
    private Long categoryUidOne;
    @ApiModelProperty(value = "商品二级ID")
    private Long categoryUidTwo;
    @ApiModelProperty(value = "商品三级ID")
    private Long categoryUidThree;
    @ApiModelProperty(value = "品牌iD")
    private Long brandUid;
    @ApiModelProperty(value = "最小 销量")
    private Long minBuyNum;
    @ApiModelProperty(value = "最大销量")
    private Long maxBuyNum;
    @ApiModelProperty(value = "最小供货价")
    private BigDecimal minCostPirce;
    @ApiModelProperty(value = "最大供货价")
    private BigDecimal maxCostPirce;
    @ApiModelProperty(value = "最小零售价")
    private BigDecimal minRetailPrice;
    @ApiModelProperty(value = "最大零售价")
    private BigDecimal maxRetailPrice;
    @ApiModelProperty(value = "最小批发价")
    private BigDecimal minTradePrice;
    @ApiModelProperty(value = "最大批发价")
    private BigDecimal maxTradePrice;
    @ApiModelProperty(value = "状态")
    private String dataStatus;
    @ApiModelProperty(value = "审核状态")
    private String auditStatus;
    @ApiModelProperty(value = "库存")
    private Integer stockNumber;
    @ApiModelProperty(value = "申请状态")
    private String sumbitStatus;
    @ApiModelProperty(value = "代表是预警列表的查询")
    private String warningQuery; //代表是预警列表的查询
    @ApiModelProperty(value = "分享起始时间")
    private String startTime;
    @ApiModelProperty(value = "分享起始时间")
    private String endTime;
    public HashMap map;
    private Long[] tagsUid;
    private List<Long> tagsProUid;
    //1是需要活动 0和空是不需要
    private String type;



    private Long majorUidOne;
    private Long majorUidTwo;
    private Long majorUidThree;
    private Long categoryUid;

    private String productNo;

    public Long getMajorUidOne() {
        return majorUidOne;
    }

    public void setMajorUidOne(Long majorUidOne) {
        this.majorUidOne = majorUidOne;
    }

    public Long getMajorUidTwo() {
        return majorUidTwo;
    }

    public void setMajorUidTwo(Long majorUidTwo) {
        this.majorUidTwo = majorUidTwo;
    }

    public Long getMajorUidThree() {
        return majorUidThree;
    }

    public void setMajorUidThree(Long majorUidThree) {
        this.majorUidThree = majorUidThree;
    }

    public Long getCategoryUid() {
        return categoryUid;
    }

    public void setCategoryUid(Long categoryUid) {
        this.categoryUid = categoryUid;
    }

    public ProductInfoQuery() {
    }

    public ProductInfoQuery(String proUis) {
        List<Long> li = new ArrayList<>();
        if (ObjectUtil.isEmpty(proUis)) this.proUids = li;
        else {
            String[] split = proUis.split(",");
            for (int i = 0; i < split.length; i++) {
                li.add(Long.valueOf(split[i]));
            }
            this.proUids = li;
        }
    }

    public Long getPlatformUid() {
        return platformUid;
    }

    public void setPlatformUid(Long platformUid) {
        this.platformUid = platformUid;
    }

    public Long getSupplierUid() {
        return supplierUid;
    }

    public void setSupplierUid(Long supplierUid) {
        this.supplierUid = supplierUid;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }


    public Long getBrandUid() {
        return brandUid;
    }

    public void setBrandUid(Long brandUid) {
        this.brandUid = brandUid;
    }

    public Long getMinBuyNum() {
        return minBuyNum;
    }

    public void setMinBuyNum(Long minBuyNum) {
        this.minBuyNum = minBuyNum;
    }

    public Long getMaxBuyNum() {
        return maxBuyNum;
    }

    public void setMaxBuyNum(Long maxBuyNum) {
        this.maxBuyNum = maxBuyNum;
    }

    public BigDecimal getMinCostPirce() {
        return minCostPirce;
    }

    public void setMinCostPirce(BigDecimal minCostPirce) {
        this.minCostPirce = NumberUtil.mul(minCostPirce, 100);
    }

    public BigDecimal getMaxCostPirce() {
        return maxCostPirce;
    }

    public void setMaxCostPirce(BigDecimal maxCostPirce) {
        this.maxCostPirce = NumberUtil.mul(maxCostPirce, 100);
    }

    public BigDecimal getMinRetailPrice() {
        return minRetailPrice;
    }

    public void setMinRetailPrice(BigDecimal minRetailPrice) {
        this.minRetailPrice = NumberUtil.mul(minRetailPrice, 100);
    }

    public BigDecimal getMaxRetailPrice() {
        return maxRetailPrice;
    }

    public void setMaxRetailPrice(BigDecimal maxRetailPrice) {
        this.maxRetailPrice = NumberUtil.mul(maxRetailPrice, 100);
    }

    public BigDecimal getMinTradePrice() {
        return minTradePrice;
    }

    public void setMinTradePrice(BigDecimal minTradePrice) {
        this.minTradePrice = NumberUtil.mul(minTradePrice, 100);
    }

    public BigDecimal getMaxTradePrice() {
        return maxTradePrice;
    }

    public void setMaxTradePrice(BigDecimal maxTradePrice) {
        this.maxTradePrice = NumberUtil.mul(maxTradePrice, 100);
    }

    public String getDataStatus() {
        return dataStatus;
    }

    public void setDataStatus(String dataStatus) {
        this.dataStatus = dataStatus;
    }

    public String getAuditStatus() {
        return auditStatus;
    }

    public void setAuditStatus(String auditStatus) {
        this.auditStatus = auditStatus;
    }

    public Integer getStockNumber() {
        return stockNumber;
    }

    public void setStockNumber(Integer stockNumber) {
        this.stockNumber = stockNumber;
    }


    public String getSumbitStatus() {
        return sumbitStatus;
    }

    public void setSumbitStatus(String sumbitStatus) {
        this.sumbitStatus = sumbitStatus;
    }

    public Long getCategoryUidOne() {
        return categoryUidOne;
    }

    public void setCategoryUidOne(Long categoryUidOne) {
        this.categoryUidOne = categoryUidOne;
    }

    public Long getCategoryUidTwo() {
        return categoryUidTwo;
    }

    public void setCategoryUidTwo(Long categoryUidTwo) {
        this.categoryUidTwo = categoryUidTwo;
    }

    public Long getCategoryUidThree() {
        return categoryUidThree;
    }

    public void setCategoryUidThree(Long categoryUidThree) {
        this.categoryUidThree = categoryUidThree;
    }


    public String getUidsStr() {
        return this.uidsStr;
    }

    public void setUidsStr(String[] uids) {
        StringBuffer stringBuffer = new StringBuffer();
        if (uids != null && uids.length > 0) {
            Arrays.stream(uids).forEach(s -> stringBuffer.append(s + ","));
            String s = stringBuffer.toString();
            this.uidsStr = s.substring(0, s.length() - 1);
        }
    }

    public String getWarningQuery() {
        return warningQuery;
    }

    public void setWarningQuery(String warningQuery) {
        this.warningQuery = warningQuery;
    }

    public List<Long> getProUids() {
        return proUids;
    }

    public void setProUids(List<Long> proUids) {
        this.proUids = proUids;
    }

    public String getSortProperty() {
        return sortProperty;
    }

    public void setSortProperty(String sortProperty) {
        this.sortProperty = sortProperty;
    }

    public String getSortType() {
        return sortType;
    }

    public void setSortType(String sortType) {
        this.sortType = sortType;
    }

    public Long getProductUid() {
        return productUid;
    }

    public void setProductUid(Long productUid) {
        this.productUid = productUid;
    }

    public void setUids(Long[] uids) {
        this.uids = uids;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public HashMap getMap() {
        return map;
    }

    public void setMap(HashMap map) {
        this.map = map;
    }

    public Long[] getUids() {
        return uids;
    }

    public Long[] getTagsUid() {
        return tagsUid;
    }

    public void setTagsUid(Long[] tagsUid) {
        this.tagsUid = tagsUid;
    }

    public List<Long> getTagsProUid() {
        return tagsProUid;
    }

    public void setTagsProUid(List<Long> tagsProUid) {
        this.tagsProUid = tagsProUid;
    }


    public String getActivityType() {
        return activityType;
    }

    public void setActivityType(String activityType) {
        this.activityType = activityType;
    }

    public Long getGroupUid() {
        return groupUid;
    }

    public void setGroupUid(Long groupUid) {
        this.groupUid = groupUid;
    }

    public Long getActivityUid() {
        return activityUid;
    }

    public void setActivityUid(Long activityUid) {
        this.activityUid = activityUid;
    }


    public Long getPageNum() {
        return pageNum;
    }

    public void setPageNum(Long pageNum) {
        this.pageNum = pageNum;
    }

    public Long getPageSize() {
        return pageSize;
    }

    public void setPageSize(Long pageSize) {
        this.pageSize = pageSize;
    }

    public String getProductNo() {
        return productNo;
    }

    public void setProductNo(String productNo) {
        this.productNo = productNo;
    }
}
